home *** CD-ROM | disk | FTP | other *** search
- class InstallStep extends mx.core.UIObject
- {
- var __stepRefs;
- var __bottom;
- var __btnListener;
- var __scrollPane;
- var __stepsClip;
- var dispatchEvent;
- static var symbolName = "InstallStep";
- static var symbolOwner = InstallStep;
- var className = "InstallStep";
- static var version = "0.0.0.1";
- static var __maxPageHeight = 300;
- static var __pageBorder = 5;
- static var __vSpacing = 5;
- static var __hSpacing = 5;
- var __nextDepth = 1;
- function InstallStep()
- {
- super();
- mx.events.EventDispatcher.initialize(this);
- }
- function init(Void)
- {
- super.init();
- this.__stepRefs = new Array();
- this.__bottom = 0;
- this.__btnListener = new Object();
- this.__btnListener.click = function(evtObj)
- {
- _level0.getURL(evtObj.target.target);
- };
- }
- function size(Void)
- {
- super.size();
- }
- function get numSteps()
- {
- return this.__stepRefs.length;
- }
- function set clipHolder(scrollPane)
- {
- this.__scrollPane = scrollPane;
- }
- function doneSetting()
- {
- trace("--- DONE SETTING ---");
- trace(this.__stepRefs[0]);
- trace(this.__stepRefs[0].text);
- trace("");
- var adjustment = this.createEmptyMovieClip("bottomAdjust",this.__nextDepth);
- with(adjustment)
- {
- beginFill("0xFFFFE5",0);
- moveTo(0,0);
- lineTo(0,20);
- lineTo(10,20);
- endFill();
- }
- adjustment._visible = true;
- adjustment._x = 0;
- adjustment._y = this.__bottom;
- this.__bottom = adjustment._y + adjustment._height;
- trace("__bottom: " + this.__bottom);
- trace("adjustment: " + adjustment._y);
- trace("adjustment: " + adjustment._height);
- if(this.__scrollPane != undefined)
- {
- if(this.height > this.__scrollPane.height - 4)
- {
- this.__scrollPane.setSize(this.__scrollPane.width + 20,this.__scrollPane.height);
- this.__scrollPane.move(this.__scrollPane._x - 10,this.__scrollPane._y);
- }
- }
- trace("numSteps: " + this.numSteps);
- if(this.numSteps == 1)
- {
- trace("THERE IS ONLY ONE STEP");
- this.__stepRefs[0].text = this.__stepRefs[0].text.slice("<img src=\'step1\' hspace=\'8\' vspace=\'3\' height=\'32\' />".length);
- }
- if(this.height <= this.__scrollPane.height - 4)
- {
- _level0.stepsPane.move(-5,29);
- _level0.stepsPane.setSize(_level0.stepsPane.width + 15,_level0.stepsPane.height);
- trace(this.__stepRefs[0].width);
- this.__stepRefs[0].setSize(this.__stepRefs[0].width + 15,this.__stepRefs[0].height);
- trace(this.__stepRefs[0].width);
- trace("sending " + Math.ceil(this.__bottom) + " as bottom of Flash movie to Director");
- this.repositionCloseBtn(this.__bottom);
- var integerBottom = Math.ceil(this.__bottom);
- §§push(this.getURL("lingo: resizeDialog " add integerBottom));
- }
- }
- function repositionCloseBtn(bottom)
- {
- trace("reposition received: " + bottom);
- _level0.closeBtn.move(_level0.closeBtn.x,bottom + 25);
- _level0.footerBar._y = bottom + 15;
- _level0.footerBar._visible = true;
- _level0.gradients._visible = false;
- this.__bottom = _level0.closeBtn.y + _level0.closeBtn.height + 11;
- }
- function get clipPosn()
- {
- return this.__stepsClip._x + ", " + this.__stepsClip._y;
- }
- function set title(title)
- {
- var _loc2_ = this.attachMovie("Label","dlgTitle",this.__nextDepth);
- this.__nextDepth = this.__nextDepth + 1;
- _loc2_.autoSize = "none";
- _loc2_.setSize(260,22);
- _loc2_.embedFonts = true;
- _loc2_.setStyle("styleName","dialogTitleStyle");
- _loc2_.text = title;
- _loc2_.move(34,4);
- }
- function set step(stepData)
- {
- var _loc17_ = undefined;
- var _loc9_ = this.__stepRefs.length + 1;
- var _loc12_ = undefined;
- if(_loc9_ >= 1 && _loc9_ <= 10)
- {
- _loc12_ = "step" + _loc9_;
- }
- else
- {
- _loc12_ = "step25";
- }
- var _loc13_ = "step" + _loc9_;
- var _loc3_ = this.attachMovie("TextArea",_loc13_,this.__nextDepth);
- this.__nextDepth = this.__nextDepth + 1;
- _loc3_.wordWrap = true;
- _loc3_.editable = false;
- _loc3_.label.selectable = false;
- _loc3_.borderStyle = "none";
- _loc3_.hScrollPolicy = _loc3_.vScrollPolicy = "off";
- _loc3_.html = true;
- _loc3_.embedFonts = true;
- _loc3_.styleSheet = _global.stepStyles;
- _loc3_.setStyle("styleName","scrollTextAreaStyle");
- _loc3_.text = "<img src=\'" + _loc12_ + "\' hspace=\'8\' vspace=\'3\' height=\'32\' /><stepbody>" + stepData.stepText + "</stepbody>";
- _loc3_.move(0,this.__bottom + 6);
- var _loc6_ = undefined;
- _loc6_ = _loc3_.styleSheet._styles.stepbody.getTextExtent(this.removeHTMLTags(stepData.stepText),305);
- trace("GETTEXTEXTENT2:");
- trace(" " + _loc6_);
- trace(" " + _loc6_.width);
- trace(" " + _loc6_.height);
- var _loc16_ = _level0.stepsPane.height;
- var _loc10_ = _loc6_.ascent + _loc6_.descent;
- trace("rowHeight: " + _loc10_);
- var _loc5_ = _loc10_ + 4;
- var _loc7_ = _loc6_.textFieldHeight;
- var _loc8_ = 0;
- while(_loc7_ > _loc5_)
- {
- _loc8_ = _loc8_ + 1;
- _loc7_ -= _loc5_;
- }
- var _loc14_ = _loc8_ != 0 ? 6 + _loc10_ + _loc8_ * _loc5_ : 6 + _loc10_;
- trace("AUTO TEXTFIELDHEIGHT: " + _loc6_.textFieldHeight);
- trace("ADJUSTED TEXTFIELDHEIGHT: " + 1.15 * _loc6_.textFieldHeight);
- trace("MANUAL TEXTFIELDHEIGHT: " + _loc14_);
- _loc3_.setSize(_loc6_.textFieldWidth,1.15 * _loc6_.textFieldHeight + 4);
- this.__stepRefs.push(_loc3_);
- if(_loc3_.height < 45)
- {
- _loc3_.setSize(_loc3_.width,48.85);
- }
- this.__bottom = _loc3_._y + _loc3_.height + InstallStep.__vSpacing;
- if(stepData.target != undefined)
- {
- var _loc15_ = "btn" + _loc9_;
- var _loc4_ = this.attachMovie("Button",_loc15_,this.__nextDepth);
- this.__nextDepth = this.__nextDepth + 1;
- _loc4_.embedFonts = true;
- _loc4_.styleSheet = _global.stepStyles;
- _loc4_.setStyle("styleName","buttonStyle");
- _loc4_.label = stepData.btnlabel.toUpperCase();
- _loc4_.target = stepData.target;
- _loc4_.addEventListener("click",this.__btnListener);
- _loc6_ = _loc4_.styleSheet._styles.stepbtn.getTextExtent(this.removeHTMLTags(stepData.btnlabel));
- _loc4_.setSize(_loc6_.textFieldWidth + 30,_loc4_.height);
- _loc4_.move(_loc3_._x + _loc3_.width - _loc4_.width - 10,this.__bottom);
- this.__bottom = _loc4_.top + _loc4_.height + 2 * InstallStep.__vSpacing;
- }
- trace("Step text height: " + _loc3_.height);
- trace("");
- }
- function removeHTMLTags(htmlText)
- {
- var _loc6_ = function(txt, index)
- {
- return txt.indexOf("<",index);
- };
- var _loc8_ = function(txt, index)
- {
- return txt.indexOf(">",index);
- };
- var _loc2_ = new Array();
- var _loc7_ = 0;
- var _loc9_ = undefined;
- var _loc10_ = undefined;
- while(_loc7_ < htmlText.length)
- {
- _loc9_ = _loc6_(htmlText,_loc7_);
- if(_loc9_ == -1)
- {
- break;
- }
- _loc10_ = _loc8_(htmlText,_loc9_);
- var _loc3_ = _loc6_(htmlText,_loc10_);
- while(_loc3_ == _loc10_ + 1)
- {
- _loc10_ = _loc8_(htmlText,_loc3_);
- _loc3_ = _loc6_(htmlText,_loc10_);
- }
- _loc2_.push({start:_loc9_,end:_loc10_});
- _loc7_ = _loc10_ + 1;
- }
- var _loc5_ = 0;
- while(_loc5_ < _loc2_.length)
- {
- _loc9_ = _loc2_[_loc5_].start;
- var _loc11_ = htmlText.charAt(_loc2_[_loc5_].start);
- _loc10_ = _loc2_[_loc5_].end;
- var _loc12_ = htmlText.charAt(_loc2_[_loc5_].end);
- var _loc16_ = htmlText.substring(_loc9_ + 1,_loc10_);
- _loc5_ = _loc5_ + 1;
- }
- if(_loc2_.length != 0)
- {
- var _loc18_ = "";
- if(_loc2_[0].start > 0)
- {
- _loc18_ += htmlText.substring(0,_loc2_[0].start);
- }
- var _loc4_ = 0;
- while(_loc4_ < _loc2_.length - 1)
- {
- var _loc13_ = _loc2_[_loc4_].end + 1;
- var _loc15_ = _loc2_[_loc4_ + 1].start;
- _loc18_ += htmlText.substring(_loc2_[_loc4_].end + 1,_loc2_[_loc4_ + 1].start);
- _loc4_ = _loc4_ + 1;
- }
- if(_loc2_[_loc2_.length - 1].end < htmlText.length - 1)
- {
- _loc18_ += htmlText.substring(_loc2_[_loc2_.length - 1].end + 1);
- }
- return _loc18_;
- }
- return htmlText;
- }
- function sendMessage(p_msgtxt)
- {
- var _loc2_ = {target:this,type:"pageReady"};
- _loc2_.msgtxt = p_msgtxt;
- this.dispatchEvent(_loc2_);
- }
- }
-